<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Bootstrap</title>
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://static.bootcss.com/www/assets/css/site.min.css?1503034592571" rel="stylesheet">
</head>
<body>
  <!--注意：1.弹出层必须放在body里
       2.弹出层里面不能再嵌套别的层
       3.弹出层弹出来以后，页面的滚动条会被覆盖-->
  <div class="container">
    <div class="row">
      <button class="btn btn-primary" data-toggle="modal" data-target=".myModal1">弹出一个小层</button><!--data-toggle="modal"给button一个点击事件，弹出一个模态窗口-->
      <button class="btn btn-primary" data-toggle="modal" data-target=".myModal2">弹出一个大层</button>
    </div>
  </div>
  <div class="modal fade myModal1"><!--modal,弹出层父级,fade使弹出层有一个运动过程-->
    <div class="modal-dialog"><!--modal-dialog,弹出层-->
      <div class="modal-content"><!--modal-content,弹出层内容区域-->
        <div class="modal-header">
          <button class="close" data-dismiss="modal">×</button><!--将关闭按钮放在标题前面可以使按钮位于右上角-->
          <h4>水果摊</h4>
        </div><!--modal-header,弹出层头部区域-->
        <div class="modal-body">
          <p>苹果葡萄香蕉柿子火龙果便宜卖了，多买优惠更多，还在等什么呢？</p>
          <p>苹果葡萄香蕉柿子火龙果便宜卖了，多买优惠更多，还在等什么呢？</p>
          <p>苹果葡萄香蕉柿子火龙果便宜卖了，多买优惠更多，还在等什么呢？</p>
        </div><!--modal-body,弹出层主体区域-->
        <div class="modal-footer">
          <button class="btn btn-primary" data-dismiss="modal">确定</button><!--data-dismiss="modal"点击按钮之后可以关闭窗口-->
        </div><!--modal-footer,弹出层底部区域-->
      </div>
    </div>
  </div>
  <div class="modal myModal2"><!---->
    <div class="modal-dialog modal-lg"><!--还有modal-sm，modal-md-->
      <div class="modal-content">
        <div class="modal-header">
          <button class="close" data-dismiss="modal">×</button>
          <h4>水果摊</h4>
        </div>
        <div class="modal-body">
          <p>苹果葡萄香蕉柿子火龙果便宜卖了，多买优惠更多，还在等什么呢？</p>
          <p>苹果葡萄香蕉柿子火龙果便宜卖了，多买优惠更多，还在等什么呢？</p>
          <p>苹果葡萄香蕉柿子火龙果便宜卖了，多买优惠更多，还在等什么呢？</p>
        </div>
        <div class="modal-footer">
          <button class="btn btn-primary" data-dismiss="modal">确定</button>
        </div>
      </div>
    </div>
  </div>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>